:root {
  --red: rgb(255, 59, 48);
  --yellow: #ffc107;
  --blue: #6495ed;
  --green: #39c5bb;
  --brown: #795548;
  --light-brown: #67492e;
  --purple: #8a2be2;
  --light-bg: #fff;
  --light-font: #fff;
  --shallow: #eee;
  --pink: #eb445a;
  --primary: var(--green);

  --code-bg: transparent;
  --black: #353535;
  --bg-opacity: rgb(255 255 255 / 50%);

  --gray: var(--gray-4);
  --deep-gray: var(--gray-1);

  --gary-1: #8e8e93;
  --gray-2: #aeaeb2;
  --gray-3: rgb(199, 199, 204);
  --gray-4: rgb(209, 209, 214);
  --gray-5: rgb(229, 229, 234);
  --gray-6: rgb(242, 242, 247);

  --serif-font: 'Noto Serif CJK SC', 'Noto Serif SC', 'Source Han Serif SC',
    'Source Han Serif', source-han-serif-sc, SongTi SC, 'PingFang SC', SimSum,
    'Hiragino Sans GB', 'Heiti SC', 'Microsoft YaHei', 'WenQuanYi Micro Hei';
  --sans-font: -apple-system, PingFang SC, Helvetica, noto sans sc,
    hiragino sans gb, microsoft yahei, 'sans-serif';
  --monospace-font: OperatorMonoSSmLig Nerd Font, JetBrains Mono, Operator Mono,
    Monaco, Consolas, 'Courier New', Courier, monospace;
  --mono-font: var(--monospace-font);
}

html.dark {
  --red: rgb(255, 69, 58) !important;
  --blue: #81cffa !important;
  --green: #1f8f93 !important;
  --yellow: #ffc107 !important;
  --brown: #c6aa9f !important;
  --light-brown: #bc9c8f !important;
  --purple: #b260ea !important;
  --light-bg: #111 !important;
  --light-font: #ddd !important;
  --shallow: #333 !important;
  --pink: #eb4b63 !important;

  --black: #ddd;
  --bg-opacity: rgb(17 17 17 / 50%);

  --gary-1: rgb(142, 142, 147);
  --gray-2: rgb(99, 99, 102);
  --gray-3: rgb(72, 72, 74);
  --gray-4: rgb(58, 58, 60);
  --gray-5: rgb(44, 44, 46);
  --gray-6: rgb(28, 28, 30);

  @supports not (backdrop-filter: blur(1px)) {
    & {
      --bg-opacity: rgb(17 17 17 / 98%);
    }
  }
}

@supports not (backdrop-filter: blur(1px)) {
  :root {
    --bg-opacity: #fff;
  }
}

html {
  font: 14px/1.15 var(--sans-font);
  color: var(--black);
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  /*  for firefox */
  scrollbar-color: var(--yellow) transparent;
  scrollbar-width: thin;

  overflow: overlay;
  scroll-behavior: unset;
  font-variant-numeric: tabular-nums;
  font-display: swap;
  font-size: 14px;
}

@media (max-width: 799px) {
  body {
    max-width: 100vw;
    overflow-x: hidden;
  }
}

body::-webkit-scrollbar {
  height: 0;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover {
  background-color: var(--yellow);
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: 5px;
}

html.dark img {
  filter: brightness(0.6) !important;
}

body * {
  transition: color 0.1s ease-in, background 0.1s ease-in, border 0.1s ease-in;
}

body {
  padding-top: 4em;
  background-color: var(--light-bg);
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
  background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--yellow);
}

::-webkit-scrollbar-thumb:hover {
  background: #ff9800;
}

::-webkit-scrollbar-corner {
  background: var(--light-bg);
}
/* 样式重置 */
h1 {
  font-weight: 500;
  font-size: 2em;
}

h2,
h3,
h4,
h5,
h6 {
  font-weight: 400;
  margin-bottom: 1rem;
}

h1:last-child,
h2:last-child,
h3:last-child,
h4:last-child,
h5:last-child,
h6:last-child,
p:last-child {
  margin-bottom: 0;
}

a:hover {
  color: var(--yellow);
}

a,
.btn {
  transition: color 0.5s, background 0.5s;
}

.btn {
  cursor: pointer;
  background: var(--light-bg);
  color: var(--shizuku-text-color);
  padding: 0.5em 1em;
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 1em;
}

.btn:hover {
  color: inherit;
}

/* -- 禁用的按钮 */
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* -- 按钮颜色 */
.btn.red,
.btn.yellow,
.btn.blue,
.btn.green {
  color: #fff;
}

.btn.red {
  background: var(--red);
}

.btn.yellow {
  background: var(--yellow);
}

.btn.blue {
  background: var(--blue);
}

.btn.green {
  background: var(--green);
}

.btn i {
  margin-right: 0;
}

.btn.brown {
  color: #fff;
  background: var(--brown);
}

.btn.black {
  color: #fff;
  background: #010101;
}

em,
mark,
kbd {
  padding: 0.25em 0.5em;
  border-radius: 0.5em;
}

em {
  color: #fff;
  font-style: normal;
  background: var(--blue);
}

kbd {
  font-size: 0.85em;
  color: #fff;
  background: #333;
  font-family: var(--mono-font);
}

article img {
  border-radius: 0.5em;
}

:not(pre) > code {
  color: var(--pink);
  font-size: 85%;
  word-wrap: normal;
  border-radius: 0.5em;
  padding: 0.25em 0.5em;
  word-break: break-all;
  background-color: #f7f2f4;
}

blockquote {
  margin: 0 0 1em;
  line-height: 1.8;
  background: #f5fafd;
  padding: 1em 1em 1em 2em;
  border-left: 3px var(--blue) solid;
}

input[type='checkbox'] {
  position: relative;
  margin: 0 1rem 0 0;
}

input[type='checkbox']:before {
  transition: all 0.3s ease-in-out;
  content: '';
  position: absolute;
  left: 0;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  border: 2px solid #f2f2f2;
}

input[type='checkbox']:checked:before {
  transform: rotate(-45deg);
  height: 0.5rem;
  border-color: var(--primary);
  border-top-style: none;
  border-right-style: none;
}

input[type='checkbox']:after {
  content: '';
  position: absolute;
  top: -0.125rem;
  left: 0;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--light-bg);
}

button:focus,
input:focus,
div:focus,
article:focus,
textarea:focus {
  outline: 0 !important;
}

/* - 表格 */
table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

thead {
  background-color: rgba(255, 255, 255, 0.4);
}

th {
  padding: 20px 15px;
  text-align: left;
  font-weight: 500;
  font-size: 1rem;
  text-transform: uppercase;
  position: relative;
}

table thead th:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  opacity: 0.3;
  border-bottom: 1px solid currentColor;
}

tbody {
  overflow-x: auto;
  margin-top: 0px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

td {
  padding: 15px;
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
  border-bottom: solid 1px rgba(255, 255, 255, 0.1);
}

/* - 文章 */
article {
  letter-spacing: 0.03em;
}

article a {
  word-break: break-all;
}

article > * {
  margin-bottom: 1em;
}

article > *:last-child {
  margin-bottom: 0;
}

article h1,
article h2,
article h3 {
  font-size: 1.2em;
}

article h4,
article h5,
article h6 {
  font-size: 1.1em;
}

article ul,
article ol,
article dl {
  line-height: 1.8;
}

article {
  color: var(--light-brown);
}

article > h1 {
  margin-top: 5em;
}

/* layer */
.app-content {
  min-height: calc(100vh - 10vw - 7.75em);
  position: relative;
}

main {
  margin: 0 auto;
  max-width: 75em;
  padding: 5em 2em;
  transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
  visibility: visible;
}

@media screen and (max-width: 900px) {
  main {
    padding: 3em 1.25em;
  }
}

article > h1:first-child,
h1.headline {
  margin-top: 0;
  font-size: 1.2rem;

  &::before {
    content: '';
    padding-left: 0.75em;
    border-left: 2px solid var(--yellow);
  }
}

.note-content {
  margin-bottom: 1em;
}

.note-content p {
  line-height: 2;
}

.note-content video {
  width: 100%;
  border-radius: 0.5em;
}

.note-content pre > code {
  max-height: 25em;
}

.main-article-md {
  figure {
    width: 100% !important;
    text-align: center !important;
  }
}

.kami-more {
  margin-top: 2em;
  text-align: center;
}

.kami-more .fa-spinner {
  animation: rotate 1.5s linear infinite;
}

.bangumi-item {
  height: 0;
  color: #fff;
  display: block;
  overflow: hidden;
  text-align: center;
  position: relative;
  padding-bottom: 130%;
  transition: transform 0.3s, box-shadow 0.3s;
}

.bangumi-item:hover {
  color: #fff;
  transform: translateY(-0.5em);
  box-shadow: 0 0 10px rgb(0 0 0 / 10%), 0 5px 20px rgb(0 0 0 / 20%);
}

.bangumi-item img {
  width: 100%;
}

.bangumi-item h4 {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75em;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: transform 0.3s;
  transform: translateY(2.5em);
  background: rgb(0 0 0 / 50%);
}

.bangumi-item:hover h4 {
  transform: translateY(0);
}

.bangumi-status {
  background: rgb(0 0 0 / 60%);
}

.bangumi-status,
.bangumi-status p {
  position: relative;
}

.bangumi-status p {
  margin-top: 0.75em;
}

.bangumi-status-bar {
  top: 0;
  bottom: 0;
  max-width: 100%;
  position: absolute;
  background: crimson;
}

.player {
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  color: #fff;
  color: var(--light-font);
  padding: 1em;
  position: fixed;
  background: #3c3c3c;
  display: flex;
  align-items: center;
  transform: translateY(100%);
  backface-visibility: hidden;
  transition: opacity 0.3s, transform 0.3s;
}

.action {
  z-index: 1;
  right: 1rem;
  bottom: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  width: 2.25em;
  position: fixed;
  font-size: 1.2em;
  transition: bottom 0.3s;
}

.action button {
  width: 2.25em;
  height: 2.25em;
  color: #795548;
  color: var(--brown);
  margin-top: 0.5em;
  background: #fff;
  background: var(--light-bg);
  border-radius: 66%;
  transition: transform 0.3s;
  box-shadow: 0 0 10px rgb(0 0 0 / 10%), 0 5px 20px rgb(0 0 0 / 20%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action .top {
  transform: scale(0);
}

.action .top.active {
  transform: scale(1);
}
